


// model 表模型 操作数据库里面的 collection  集合  

const mongoose  = require("mongoose");
const Schema = mongoose.Schema;

var userSchema = new Schema({   // 结构  描述 每张表的 数据结构  
    id:Number,
    name:String,
    age:Number,
    address:String
});


// 表对象模型  操作集合 
exports.Users = mongoose.model("user",userSchema);  // 复数规则 

var movieSchema = new Schema({
    "rating" : Object, 
    "genres" :Array, 
    "title" : String, 
    "casts" : Array, 
    "collect_count" : Number, 
    "original_title" : String, 
    "subtype" : String, 
    "directors" :Array, 
    "year" : String, 
    "images" :Object, 
    "alt" :String, 
    "id" : String
})

exports.Movies = mongoose.model("movie",movieSchema);   

var toDoSchema = new Schema({
    title:String,
    content:String,
    author:String,
    time:Date,
})





// pro_user   学生表   
var pro_userSchema = new Schema({
    sid:Number,
    username:String,
    mobile:Number,
    password:String,
    email:String,
    qq:String,
    classno:String,
    xueke:String,
    banji:String,
    rollType:String
})

exports.Pro_user = mongoose.model("pro_user",pro_userSchema);

var pro_techSchema = new Schema({
    tid:Number,
    username:String,
    mobile:Number,
    password:String,
    email:String,
    qq:String,
    classno:String,
    xueke:String,
    banji:String,
})

exports.Pro_tech = mongoose.model("pro_tech",pro_techSchema);

var UidSchema = new Schema({
    id:Number,
    tablename:String,  // 表名 
})

exports.Uid = mongoose.model("uid",UidSchema);

// wh1915 
// 武汉HTML5-1915
var banjiSchema =  new Schema({
    text:String,
    code:String, 
    num:String,
    xueke:String
});

exports.Banji = mongoose.model("banji",banjiSchema);


// 校区
var school =  new Schema({
    value:String,
    city:String, 
});

exports.School = mongoose.model("school",school);


// 项目类型   {value:"vue",text:"Vue"}
var project =  new Schema({
    value:String,
    text:String, 
});

exports.Project = mongoose.model("project",project);


var proxm = new Schema({
    pid:Number,
    pname:String,
    psid:Number,
    pmobile:String,
    pbanjicode:String,
    pxueke:String,
    
    proname:String,
    prourl:String,
    procode:String,
    protext:String,
    
    prodesc:String,
    projishu:String,
    proliang:String,
    pscore:Number,
    probarcode:String,
    ptime:Date
})

exports.Proxm = mongoose.model("proxm",proxm);


var userlist = new Schema({
    mobile:Number,
    password:String,
    username:String,
    rolltype:Number, // 1 普通用户  2. 管理元 3. 超级管理员 
    pic:String,
    time:Date,
    token:String
})
exports.UserList = mongoose.model("userlist1",userlist);

var tiwenlist =new Schema({
    mobile:Number,
    tiwen:Number,
    time:Date,
    flag:Boolean,  // 是否正常  
    isTest:Boolean  //是否做了核酸
    })
exports.TiWenList = mongoose.model("tiwenlist1",tiwenlist);

var goods =new Schema({
    name:String,
    price:Number,
    discount:Number,
    img:String,
    type:Object
})
exports.Goods=mongoose.model("goods1",goods);

var cart=new Schema({
    mobile:Number,
    count:Number,
    goodId:String,
    good:Object,
    time:Date,
    ischeck:Boolean
})
exports.Cart=mongoose.model("cart1",cart);

var advise=new Schema({
    mobile:Number,
    userinfo:Object,
    title:String,
    category:Array,
    content:String,
    time:Date,
})
exports.Advise=mongoose.model("advise1",advise);

var outin=new Schema({
    mobile:Number,
    username:String,
    startTime:Date,
    endTime:Date
})
exports.Outin=mongoose.model("outin1",outin);

var users=new Schema({
    mobile:Number,
    password:String,
    username:String
})
exports.Users=mongoose.model("users1",users)
